//
//  URLs.m
//  SaiNiuHui
//
//  Created by 吕飞俊 on 15/11/6.
//  Copyright © 2015年 国都快易科技（深圳）有限公司. All rights reserved.
//   _          ______   _      _
//  | |        |  ____| (_)    | |
//  | |  __   _| |__ ___ _     | |_   _ _ __
//  | |  \ \ / /  __/ _ \ |_   | | | | | '_ \
//  | |___\ V /| | |  __/ | |__| | |_| | | | |
//  |______\_/ |_|  \___|_|\____/ \__,_|_| |_|
//

#import "URLs.h"

@implementation URLs

+(instancetype)sharedInstance{
    static URLs *url = nil;
    static dispatch_once_t onceToke;
    dispatch_once(&onceToke, ^{
        url = [[URLs alloc]init];
    });
    return url;
}

+(NSString *)geturl:(NSString *)url{
    URLs *urls = [URLs sharedInstance];
    NSString *host  = URLEnumProduce;
    if (urls.enumEnvironment == EnumDevelop) {
        host = URLEnumDevelop;
    }else if (urls.enumEnvironment == EnumTest){
        host = URLEnumTest;
    }else{
        host = URLEnumProduce;
    }
    return [NSString stringWithFormat:@"%@%@",host,url];
}

+(NSString *)getStockurl:(NSString *)url{
    URLs *urls = [URLs sharedInstance];
    NSString *host  = StockEnumProduce;
    if (urls.enumEnvironment == EnumDevelop) {
        host = StockEnumDevelop;
    }else if (urls.enumEnvironment == EnumTest){
        host = StockEnumTest;
    }else{
        host = StockEnumProduce;
    }
    return [NSString stringWithFormat:@"%@:%@",host,url];
}

@end
